//package com.zzh.partnersys.controller;
//
//import com.zzh.partnersys.common.exception.ResultUtils;
//import com.zzh.partnersys.es.entity.UserES;
//import com.zzh.partnersys.es.repository.UserRepository;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.data.domain.PageRequest;
//import org.springframework.stereotype.Repository;
//import org.springframework.web.bind.annotation.CrossOrigin;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
///**
// * @author �?�?�?
// * @version 1.0
// */
//@RestController
//@RequestMapping("/es")
//@CrossOrigin(origins  = "*", allowCredentials = "true")
//public class ESController {
//    @Autowired
//    private UserRepository userESRepository;
//
//    @GetMapping("/searchByAll")
//    public ResultUtils searchByAll(String all) {
//        if (all == null || all.isEmpty()){
//            List<UserES> content = userESRepository.findAll(PageRequest.of(0, 20)).getContent();
//            return ResultUtils.ok(content);
//        }
//        Page<UserES> userESPage = userESRepository.findByValue(all, PageRequest.of(0, 20));
//        return ResultUtils.ok(userESPage.getContent());
//    }
//}